package lab_10.com.acme.bankapp.domain.bank;

import java.util.ArrayList;

public class Client {

	private ArrayList<Account> accounts = new ArrayList<Account>();
	private Gender gender;
	private String name;

	public Client(Gender gender, String name) {
		this.gender = gender;
		this.setName(name);

	}

	public Client(Gender gender, String name, Account firstAccount) {
		this(gender, name);
		addClientAccount(firstAccount);
	}

	public String getClientSalutation() {
		return gender.getGreeting();
	}

	public void addClientAccount(Account account) {
		accounts.add(account);
	}

	public ArrayList<Account> getAccounts() {
		return accounts;
	}

	public void printAllClientData() {
		System.out.println("---");
		System.out.format("Client: %1$s %2$s\n", getClientSalutation(),
				getName());
		for (Account account : getAccounts()) {
			System.out.println();
			account.printAllAccountData();
		}
		System.out.println("---");
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
